package cn.zhys513.scm.controller;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.zhys513.common.cache.CacheProvider;
import cn.zhys513.scm.service.ITestService;

@Controller
public class HelloController {

    @Resource(name = "cachedProvider")
    CacheProvider cache;
    
    @Autowired
    ITestService testService;
    
	@RequestMapping(value={"/","/hello"})
	public String hello(Map<String,Object> map ) { 
//	    String s = testService.test(); 
	    String s = testService.test("2222","3333"); 
	    map.put("hello", s);
		System.out.println("hello:" + s); 
		return "hello";
	} 
	
	@RequestMapping(value={"/hello3/","/hello3"})
	public String hello3(Map<String,Object> map ) {  
		testService.clearCache("1");
		return "hello";
	}
	 
	@RequestMapping(value={"/clear/","/clear"})
	public String clear() {  
		testService.clearCache("1");
		return "hello";
	}
	
}
